Integrand size = 21, antiderivative size = 70 \[ \int (a+b \sec (c+d x))^2 \tan ^2(c+d x) \, dx=-a^2 x-\frac {a b \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 \tan (c+d x)}{d}+\frac {a b \sec (c+d x) \tan (c+d x)}{d}+\frac {b^2 \tan ^3(c+d x)}{3 d} \]
-a^2*x-a*b*arctanh(sin(d*x+c))/d+a^2*tan(d*x+c)/d+a*b*sec(d*x+c)*tan(d*x+c )/d+1/3*b^2*tan(d*x+c)^3/d
Time = 0.22 (sec) , antiderivative size = 66, normalized size of antiderivative = 0.94 \[ \int (a+b \sec (c+d x))^2 \tan ^2(c+d x) \, dx=\frac {-3 a^2 \arctan (\tan (c+d x))-3 a b \text {arctanh}(\sin (c+d x))+\tan (c+d x) \left (3 a^2+3 a b \sec (c+d x)+b^2 \tan ^2(c+d x)\right )}{3 d} \]
(-3*a^2*ArcTan[Tan[c + d*x]] - 3*a*b*ArcTanh[Sin[c + d*x]] + Tan[c + d*x]* (3*a^2 + 3*a*b*Sec[c + d*x] + b^2*Tan[c + d*x]^2))/(3*d)
Time = 0.33 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 4374, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \tan ^2(c+d x) (a+b \sec (c+d x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \cot \left (c+d x+\frac {\pi }{2}\right )^2 \left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2dx\) |
\(\Big \downarrow \) 4374 |
\(\displaystyle \int \left (a^2 \tan ^2(c+d x)+2 a b \tan ^2(c+d x) \sec (c+d x)+b^2 \tan ^2(c+d x) \sec ^2(c+d x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a^2 \tan (c+d x)}{d}-a^2 x-\frac {a b \text {arctanh}(\sin (c+d x))}{d}+\frac {a b \tan (c+d x) \sec (c+d x)}{d}+\frac {b^2 \tan ^3(c+d x)}{3 d}\) |
-(a^2*x) - (a*b*ArcTanh[Sin[c + d*x]])/d + (a^2*Tan[c + d*x])/d + (a*b*Sec [c + d*x]*Tan[c + d*x])/d + (b^2*Tan[c + d*x]^3)/(3*d)
3.3.81.3.1 Defintions of rubi rules used
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + ( a_))^(n_), x_Symbol] :> Int[ExpandIntegrand[(e*Cot[c + d*x])^m, (a + b*Csc[ c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 0]
Time = 1.27 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.30
method | result | size |
parts | \(\frac {a^{2} \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {b^{2} \tan \left (d x +c \right )^{3}}{3 d}+\frac {2 a b \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(91\) |
derivativedivides | \(\frac {a^{2} \left (\tan \left (d x +c \right )-d x -c \right )+2 a b \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {b^{2} \sin \left (d x +c \right )^{3}}{3 \cos \left (d x +c \right )^{3}}}{d}\) | \(92\) |
default | \(\frac {a^{2} \left (\tan \left (d x +c \right )-d x -c \right )+2 a b \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {b^{2} \sin \left (d x +c \right )^{3}}{3 \cos \left (d x +c \right )^{3}}}{d}\) | \(92\) |
risch | \(-a^{2} x -\frac {2 i \left (3 a b \,{\mathrm e}^{5 i \left (d x +c \right )}-3 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-6 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 a b \,{\mathrm e}^{i \left (d x +c \right )}-3 a^{2}+b^{2}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}-\frac {a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}+\frac {a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) | \(143\) |
a^2/d*(tan(d*x+c)-arctan(tan(d*x+c)))+1/3*b^2*tan(d*x+c)^3/d+2*a*b/d*(1/2* sin(d*x+c)^3/cos(d*x+c)^2+1/2*sin(d*x+c)-1/2*ln(sec(d*x+c)+tan(d*x+c)))
Time = 0.27 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.64 \[ \int (a+b \sec (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {6 \, a^{2} d x \cos \left (d x + c\right )^{3} + 3 \, a b \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, a b \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (3 \, a b \cos \left (d x + c\right ) + {\left (3 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right )} \sin \left (d x + c\right )}{6 \, d \cos \left (d x + c\right )^{3}} \]
-1/6*(6*a^2*d*x*cos(d*x + c)^3 + 3*a*b*cos(d*x + c)^3*log(sin(d*x + c) + 1 ) - 3*a*b*cos(d*x + c)^3*log(-sin(d*x + c) + 1) - 2*(3*a*b*cos(d*x + c) + (3*a^2 - b^2)*cos(d*x + c)^2 + b^2)*sin(d*x + c))/(d*cos(d*x + c)^3)
\[ \int (a+b \sec (c+d x))^2 \tan ^2(c+d x) \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \tan ^{2}{\left (c + d x \right )}\, dx \]
Time = 0.28 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.17 \[ \int (a+b \sec (c+d x))^2 \tan ^2(c+d x) \, dx=\frac {2 \, b^{2} \tan \left (d x + c\right )^{3} - 6 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a^{2} - 3 \, a b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + \log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{6 \, d} \]
1/6*(2*b^2*tan(d*x + c)^3 - 6*(d*x + c - tan(d*x + c))*a^2 - 3*a*b*(2*sin( d*x + c)/(sin(d*x + c)^2 - 1) + log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)))/d
Leaf count of result is larger than twice the leaf count of optimal. 158 vs. \(2 (68) = 136\).
Time = 0.57 (sec) , antiderivative size = 158, normalized size of antiderivative = 2.26 \[ \int (a+b \sec (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {3 \, {\left (d x + c\right )} a^{2} + 3 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 4 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{3 \, d} \]
-1/3*(3*(d*x + c)*a^2 + 3*a*b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 3*a*b*l og(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*(3*a^2*tan(1/2*d*x + 1/2*c)^5 - 3*a* b*tan(1/2*d*x + 1/2*c)^5 - 6*a^2*tan(1/2*d*x + 1/2*c)^3 + 4*b^2*tan(1/2*d* x + 1/2*c)^3 + 3*a^2*tan(1/2*d*x + 1/2*c) + 3*a*b*tan(1/2*d*x + 1/2*c))/(t an(1/2*d*x + 1/2*c)^2 - 1)^3)/d
Time = 14.66 (sec) , antiderivative size = 227, normalized size of antiderivative = 3.24 \[ \int (a+b \sec (c+d x))^2 \tan ^2(c+d x) \, dx=-\frac {\frac {b^2\,\sin \left (3\,c+3\,d\,x\right )}{12}-\frac {b^2\,\sin \left (c+d\,x\right )}{4}-\frac {a^2\,\sin \left (3\,c+3\,d\,x\right )}{4}-\frac {a^2\,\sin \left (c+d\,x\right )}{4}+\frac {3\,a^2\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+\frac {a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}-\frac {a\,b\,\sin \left (2\,c+2\,d\,x\right )}{2}+\frac {3\,a\,b\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+\frac {a\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}}{d\,\left (\frac {3\,\cos \left (c+d\,x\right )}{4}+\frac {\cos \left (3\,c+3\,d\,x\right )}{4}\right )} \]
-((b^2*sin(3*c + 3*d*x))/12 - (b^2*sin(c + d*x))/4 - (a^2*sin(3*c + 3*d*x) )/4 - (a^2*sin(c + d*x))/4 + (3*a^2*cos(c + d*x)*atan(sin(c/2 + (d*x)/2)/c os(c/2 + (d*x)/2)))/2 + (a^2*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*c os(3*c + 3*d*x))/2 - (a*b*sin(2*c + 2*d*x))/2 + (3*a*b*cos(c + d*x)*atanh( sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/2 + (a*b*atanh(sin(c/2 + (d*x)/2)/ cos(c/2 + (d*x)/2))*cos(3*c + 3*d*x))/2)/(d*((3*cos(c + d*x))/4 + cos(3*c + 3*d*x)/4))